package singleton.lazy;

/**
 * @author Feng
 * @date 2019/3/10 15:30
 */
public class LazyDoubleCheckSingleton {
    private LazyDoubleCheckSingleton(){}

    private static LazyDoubleCheckSingleton lazyDoubleCheckSingleton = null;

    public static LazyDoubleCheckSingleton getInstance(){
        if(lazyDoubleCheckSingleton == null){
            synchronized (LazyDoubleCheckSingleton.class){
                if(lazyDoubleCheckSingleton == null){
                    lazyDoubleCheckSingleton = new LazyDoubleCheckSingleton();
                }
            }
        }
        return  lazyDoubleCheckSingleton;
    }
}
